home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / listbox / tlsrc / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1994-10-30  |  3.6 KB  |  111 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   4635
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   7365
  8.    Height          =   5040
  9.    Left            =   1035
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4635
  12.    ScaleWidth      =   7365
  13.    Top             =   1140
  14.    Width           =   7485
  15.    Begin CommandButton Command3 
  16.       Caption         =   "On The Fly"
  17.       Height          =   555
  18.       Left            =   6120
  19.       TabIndex        =   4
  20.       Top             =   4020
  21.       Width           =   1095
  22.    End
  23.    Begin CommandButton Command2 
  24.       Caption         =   "Add Text"
  25.       Height          =   555
  26.       Left            =   4860
  27.       TabIndex        =   3
  28.       Top             =   4020
  29.       Width           =   1095
  30.    End
  31.    Begin CommandButton Command1 
  32.       Caption         =   "Create List"
  33.       Height          =   555
  34.       Left            =   3600
  35.       TabIndex        =   2
  36.       Top             =   4020
  37.       Width           =   1095
  38.    End
  39.    Begin TextBox Text1 
  40.       Height          =   3735
  41.       Left            =   3600
  42.       MultiLine       =   -1  'True
  43.       TabIndex        =   1
  44.       Top             =   240
  45.       Width           =   3615
  46.    End
  47.    Begin ListBox List1 
  48.       Height          =   4320
  49.       Left            =   60
  50.       TabIndex        =   0
  51.       Top             =   240
  52.       Width           =   3435
  53.    End
  54. Option Explicit
  55. Sub Command1_Click ()
  56. Dim temp$
  57.     temp$ = Text1.Text
  58.     tlCreate List1, temp$
  59. End Sub
  60. Sub Command2_Click ()
  61. Dim temp$
  62.     temp$ = NewLine + "This is a 2nd root"
  63.     temp$ = temp$ + NewLine + tabs + "this are some more branches"
  64.     temp$ = temp$ + NewLine + tabs + tabs + "leaf"
  65.     temp$ = temp$ + NewLine + tabs + tabs + "leaf"
  66.     temp$ = temp$ + NewLine + tabs + "branch"
  67.     temp$ = temp$ + NewLine + tabs + tabs + "leaf"
  68.     temp$ = temp$ + NewLine + tabs + tabs + "leaf"
  69.     temp$ = temp$ + NewLine + tabs + tabs + "branch"
  70.     temp$ = temp$ + NewLine + tabs + tabs + tabs + "leaf"
  71.     Text1.Text = Text1.Text + temp$
  72.     Command2.Enabled = False
  73. End Sub
  74. Sub Command3_Click ()
  75.     tlAddLine "My New Root", 0, alNew, List1
  76.     tlAddLine "branch", 1, alAdd, List1
  77.     tlAddLine "leaf", 2, alAdd, List1
  78.     tlAddLine "leaf", 1, alAdd, List1
  79.     tlAddLine "branch", 1, alAdd, List1
  80.     tlAddLine "leaf", 2, alAdd, List1
  81.     tlAddLine "branch", 2, alAdd, List1
  82.     tlAddLine "leaf", 3, alAdd, List1
  83.     tlAddLine "leaf", 2, alAdd, List1
  84.     tlAddLine "leaf", 2, alAdd, List1
  85.     tlAddLine "leaf", 1, alAdd, List1
  86.     tlAddLine "New Root", 0, alAdd, List1
  87.     tlAddLine "leaf", 1, alCreate, List1
  88. End Sub
  89. Sub Form_Load ()
  90. Dim temp$
  91.     NewLine = Chr$(13) + Chr$(10)
  92.     tabs = Chr$(9)
  93.     temp$ = "This is the root"
  94.     temp$ = temp$ + NewLine + tabs + "This is a leaf"
  95.     temp$ = temp$ + NewLine + tabs + "This is another leaf"
  96.     temp$ = temp$ + NewLine + tabs + "This is a branch with leaves"
  97.     temp$ = temp$ + NewLine + tabs + tabs + "This is a leaf"
  98.     temp$ = temp$ + NewLine + tabs + tabs + "This is another one"
  99.     temp$ = temp$ + NewLine + tabs + "Add some new branches with"
  100.     temp$ = temp$ + NewLine + tabs + "[ENTER] and"
  101.     temp$ = temp$ + NewLine + tabs + "[Ctrl]+[TAB]"
  102.     temp$ = temp$ + NewLine + tabs + "or change the existing ones"
  103.     temp$ = temp$ + NewLine + tabs + "..."
  104.     Text1.Text = temp$
  105. End Sub
  106. Sub List1_DblClick ()
  107.     If tlDblClick(List1) Then
  108.     MsgBox "This was a DblClick on the leaf:" + NewLine + List1.Text
  109.     End If
  110. End Sub
  111.